package nan.yunsuanfu2;

public class Main {
    public static void main3(String[] args) {
        int a = 10;
        int b = 20;
        System.out.println(a == b);
    }

    public static void main2(String[] args) {
        int i = 10;
        int b = i++;
        System.out.println(++i);
        System.out.println(i++);
        System.out.println(b);
        System.out.println(i);
    }

    public static void main1(String[] args) {
        int a = 5;
        int b = 2;
        int c = a / b;
        System.out.println(5 / 2);
        System.out.println(5.0 / 2.0);
        System.out.println((float) 5 / 2);
        System.out.println(5 / (float) 2);
    }

    public static void main0(String[] args) {
        double d = 10.5;
        double e = 2.0;
        float x = (float) (d % e);
        System.out.println(x);
    }
    /*
    给定两个int变量，交换变量的值
     */
    public static void main4(String[] args) {
        int a=1;
        int b=2;
        int c;
        c=a;
        a=b;
        b=c;
        System.out.println(a);
        System.out.println(b);
    }
/*
给定三个int变量，求其中最大值和最小值
 */
    public static void main6(String[] args) {
        int a=5,b=9,c=2;
        int y = a>b ? a : b;
        int max = y>c ? y : c ;
        int x = a>b ? b : a;
        int min = x>c ? c : x;
        System.out.println(max);
        System.out.println(min);
    }

    public static void main5(String[] args) {
        int a=10;
        int b=20;
        int max= a > b ? a : b;
    }
}